package com.guoxin.concurrentcy.chapter4;

/**
 * @author guoxin
 * @date 2019/7/2
 */
public class DaemonThread {

    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            try {
                System.out.println(Thread.currentThread().getName() + " running");
                Thread.sleep(1000);
                System.out.println(Thread.currentThread().getName() + " done");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        t.setDaemon(true);
        t.start();
        Thread.sleep(1000);
        System.out.println(Thread.currentThread().getName());

    }
}
